From ec0584884396e8506f797cef0599f23684569522 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Thu, 5 Jan 2012 16:14:52 +0000 Subject: [PATCH] (bug 33456) show $wgQueryCacheLimit on cached query pages, so users know that the results are artificially cut off, and its not just that there is only 1000 wanted files (or whatever else) on the wiki. --- RELEASE-NOTES-1.19 | 1 + includes/QueryPage.php | 8 +++++--- languages/messages/MessagesEn.php | 4 ++-- languages/messages/MessagesQqq.php | 4 +++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index edc84ed6a7..794da3fb80 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -116,6 +116,7 @@ production. Enable by setting $wgEnableJavaScriptTest to true. * Extensions can use the RequestContextCreateSkin hook to override what skin is loaded in some contexts. +* (bug 33456) Show $wgQueryCacheLimit on cached query pages. === Bug fixes in 1.19 === * $wgUploadNavigationUrl should be used for file redlinks if. diff --git a/includes/QueryPage.php b/includes/QueryPage.php index ef675c0e53..12321abcc8 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -437,6 +437,7 @@ abstract class QueryPage extends SpecialPage { * real, honest-to-gosh query page. */ function execute( $par ) { + global $wgQueryCacheLimit; if ( !$this->userCanExecute( $this->getUser() ) ) { $this->displayRestrictionError(); return; @@ -468,17 +469,18 @@ abstract class QueryPage extends SpecialPage { # Fetch the timestamp of this update $ts = $this->getCachedTimestamp(); + $lang = $this->getLanguage(); + $maxResults = $lang->formatNum( $wgQueryCacheLimit ); if ( $ts ) { - $lang = $this->getLanguage(); $updated = $lang->timeanddate( $ts, true, true ); $updateddate = $lang->date( $ts, true, true ); $updatedtime = $lang->time( $ts, true, true ); $out->addMeta( 'Data-Cache-Time', $ts ); $out->addInlineScript( "var dataCacheTime = '$ts';" ); - $out->addWikiMsg( 'perfcachedts', $updated, $updateddate, $updatedtime ); + $out->addWikiMsg( 'perfcachedts', $updated, $updateddate, $updatedtime, $maxResults ); } else { - $out->addWikiMsg( 'perfcached' ); + $out->addWikiMsg( 'perfcached', $maxResults ); } # If updates on this page have been disabled, let the user know diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 9af7999df5..7774927236 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -999,8 +999,8 @@ It may have already been deleted by someone else.', 'badtitle' => 'Bad title', 'badtitletext' => 'The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.', -'perfcached' => 'The following data is cached and may not be up to date.', -'perfcachedts' => 'The following data is cached, and was last updated $1.', +'perfcached' => 'The following data is cached and may not be up to date. A maximum of $1 results are available in the cache.', +'perfcachedts' => 'The following data is cached, and was last updated $1. A maximum of $4 results are available in the cache.', 'querypage-no-updates' => 'Updates for this page are currently disabled. Data here will not presently be refreshed.', 'wrong_wfQuery_params' => 'Incorrect parameters to wfQuery()
diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index cc5cf92aa4..cf7115d03e 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -655,10 +655,12 @@ $1 is a filename, I think.', * $1 is the page name', 'badtitle' => 'The page title when a user requested a page with invalid page name. The content will be {{msg-mw|badtitletext}}.', 'badtitletext' => 'The message shown when a user requested a page with invalid page name. The page title will be {{msg-mw|badtitle}}.', +'perfcached' => 'Like {{msg-mw|perfcachedts}} but used when we do not know how long ago page was cached (unlikely to happen). $1 is the max result cut off ($wgQueryCacheLimit)', 'perfcachedts' => 'Used on pages that list page lists for which the displayed data is cached. Parameters: * $1 is a time stamp (date and time combined) * $2 is a date (optional) -* $3 is a time (optional)', +* $3 is a time (optional) +* $4 is the cut off limit for cached results ($wgQueryCacheLimit). If there are more then this many results for the query, only the first $4 of those will be listed on the page. Usually $4 is about 1000.', 'querypage-no-updates' => 'Text on some special pages, e.g. [[Special:FewestRevisions]].', 'viewsource' => 'The text displayed in place of the "edit" tab when the user has no permission to edit the page. -- 2.20.1